﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Coder.Workflow.Mapping
{
    public class WorkTaskMapping : IEntityTypeConfiguration<WorkTask>
    {
        public void Configure(EntityTypeBuilder<WorkTask> builder)
        {
            builder.HasKey(_ => _.Id);
            builder.Property(_ => _.Id).ValueGeneratedOnAdd();
            builder.Property(_ => _.Name).HasMaxLength(32);
            builder.Property(_ => _.Ordered);
            builder.Property(_ => _.CanEdit);
            builder.HasOne(_ => _.Role);
            builder.Property(_ => _.CanReject);
            builder.Property(_ => _.CanGiveUp);
            builder.Property(_ => _.DefaultResolveComment).HasMaxLength(64);
        }
    }
}